Solution of the Diffusion equation with Dirichlet and Neumann boundary conditions